package com.leetcode;

/**
 * 762. 二进制表示中质数个计算置位
 * 位运算
 */
public class Solution762_1 {

    public int countPrimeSetBits(int left, int right) {
        int count = 0;
        for (int i = left; i <= right; i++) {
            if (((1 << Integer.bitCount(i)) & 665772) != 0) {
                count++;
            }
        }
        return count;
    }

    public static void main(String[] args) {
        int left = 6;
        int right = 10;
        int count = new Solution762_1().countPrimeSetBits(left, right);
        System.out.println(count);
    }

}
